package com.yzq.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yzq.model.dto.comment.CommentsQueryRequest;
import com.yzq.model.dto.comment.CommentsRequest;
import com.yzq.model.entity.Comments;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yzq.model.vo.CommentsVO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
* @author yezhi
* @description 针对表【comments(评论表)】的数据库操作Service
* @createDate 2025-07-07 14:27:55
*/
public interface CommentsService extends IService<Comments> {
    /**
     * 添加评论
     * @param commentsRequest 评论请求
     * @param request 请求
     * @return 评论结果
     */
    Boolean addComment(CommentsRequest commentsRequest, HttpServletRequest request);

    /**
     * 分页获取评论列表
     * @param commentsQueryRequest 评论查询请求
     * @return 评论分页列表
     */
    Page<Comments> getCommentList(CommentsQueryRequest commentsQueryRequest);

    /**
     * 根据图片ID获取评论及其子评论
     * @param pictureId 图片ID
     * @return 评论及其子评论列表
     */
    List<CommentsVO> getCommentsWithChildrenByPictureId(Long pictureId);

    /**
     * 删除评论及其所有子评论
     * @param commentId 评论ID
     * @param request 请求
     * @return 删除结果
     */
    boolean deleteCommentAndChildren(Long commentId, HttpServletRequest request);

}
